// Location.h
//
// Created By: Jeremy Butler
// Created On: 21-Mar-2011
//
// A generic two dimensional location.

#ifndef LOCATION_H
#define LOCATION_H

class Location{
private:
  int x;
  int y;
public:
  //! @brief No-Arg Contructor
  Location();

  //! @brief Copy Constructor
  //! @param other The Location to be copied.
  Location(const Location & other);

  //! @brief Constructor
  //! @param x An integer representation of the x coordinate of this Location.
  //! @param y An integer representation of the y coordinate of this Location.
  Location(int x, int y);

  //! @brief Destructor
  virtual ~Location();

  //! @brief Operator = used to copy a Location to this one.
  //! @param other The Location to be copied.
  //! @return a reference to the newly copied Location.
  Location & operator = (const Location & other);

  //! @brief Operator < used for comparison.
  //! @param other The Location to be compared.
  //! @return true if x+y of other is greater than this x+y, false otherwise.
  bool operator < (const Location & other) const;

  //! @brief Operator == used for comparison.
  //! @param other The Location to be compared.
  //! @return true if x+y of other is equal to this x+y, false otherwise.
  bool operator == (const Location & other) const;

  //! @brief Get the x coordinate of this Location.
  //! @return an integer corresponding to the x coordinate of this Location.
  int GetX() const;
  
  //! @brief Get the y coordinate of this Location.
  //! @return an integer corresponding to the y coordinate of this Location.
  int GetY() const;

  //! @brief Set the x coordinate of this Location.
  //! @param _x An integer corresponding to the y coordinate of this Location.
  void SetX(int _x);

  //! @brief Set the y coordinate of this Location.
  //! @param _y An integer corresponding to the y coordinate of this Location.
  void SetY(int _y);

  //! @brief Set both x and y coordinate of this Location.
  //! @param _x An integer corresponding to the x coordinate of this Location.
  //! @param _y An integer corresponding to the y coordinate of this location.
  void Set(int _x, int _y);

  //! @brief Comparison method
  //! @param _x the x coordinate to compare to this x coordinate.
  //! @param _y the y coordinate to compare to this y coordinate. 
  bool Equals(int _x, int _y);
  
};

#endif /* LOCATION_H */
